// 业务接口封装

import { get, post, put, deletes } from '../utils/http'
// 登录接口
export const loginAdmin = params => {
    return post('/admin/login', params);
}
//------------------后台用户模块---------------------------
export const getAllUser = params => {
    return get("/admin/users", params);
};
export const addUser = params => {
    return post("/admin/user", params);
};
export const userEdit = params => {
    return put('/admin/user', params)
}
export const userDelete = params => {
    return deletes('/admin/user', params)
}
export const userSearch = params => {
    return get('/admin/user/search', params)
}
//-----------------分类-----------------
export const getClassfy = () => {
    return get('/admin/classes')
}
//-----------------文章--------------------
export const getArtical = params => {
    return get('/admin/articals', params)
}
export const addArtical = params =>{
    return post('/admin/artical',params)
}
export const getOneArtical = params =>{
    return get(`/admin/artical/${params}`)
}
export const editArtical = params =>{
    return put('/admin/artical',params)
}
export const deleteArtical = params =>{
    return deletes("/admin/artical",params)
}
// -----------------轮播图-----------------
export const getBanner = () =>{
    return get("/admin/banners")
}
export const addBanner = params =>{
    return post("/admin/banner",params)
}
export const deleteBanner = params =>{
    return deletes("/admin/banner",params)
}
export const editBanner = params =>{
    return put("/admin/banner",params)
}